package cn.com.callback;

import cn.com.elite.EliteBean
import net.sf.json.JSONArray;
import net.sf.json.JSONObject
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author ThinkPad*
 */

public class getRight implements ServiceBackInvoke {

    private static final Log log = LogFactory.getLog(getRight.class);

    public String doCallBack(EliteBean eliteBean, HttpServletRequest request, HttpServletResponse response) {
        log.debug("获取广告区域信息...");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=UTF-8");

        String DBS = "dataSource";

        String getRightdataSQL = "Select Orderid, Questionname, Content From Chat_Rightdata_Question Where Type = '1' Order By Orderid Limit 6";
        List getRightdataResult = eliteBean.chaxun_sql(getRightdataSQL, DBS);

        JSONObject questions = new JSONObject();
        JSONArray RightdataArray = JSONArray.fromObject(getRightdataResult)
        questions.put("status", "success");
        questions.put("data", RightdataArray);

        log.debug("获取广告区域信息：" + questions.toString());
        return questions;

        int result = xieruiming.add(1,2);
    }
}